.TH strerror 3 "" "" ""
.SH SYNOPSIS
strerror \- convert error number to string
.SH ANSI_SYNOPSIS
#include <string.h>
.br
char *strerror(int 
.IR errnum );
.br
.SH TRAD_SYNOPSIS
#include <string.h>
.br
char *strerror(
.IR errnum )
.br
int 
.IR errnum ;
.br
.SH DESCRIPTION
.BR strerror 
converts the error number 
.IR errnum 
into a
string. The value of 
.IR errnum 
is usually a copy of 
.BR errno .
If 
.BR errnum 
is not a known error number, the result points to an
empty string.

This implementation of 
.BR strerror 
prints out the following strings
for each of the values defined in `
.BR errno.h ':

o+
o E2BIG
Arg list too long

o EACCES
Permission denied

o EADV
Advertise error

o EAGAIN
No more processes

o EBADF
Bad file number

o EBADMSG
Bad message

o EBUSY
Device or resource busy

o ECHILD
No children

o ECOMM
Communication error

o EDEADLK
Deadlock

o EEXIST
File exists

o EDOM
Math argument

o EFAULT
Bad address

o EFBIG
File too large

o EIDRM
Identifier removed

o EINTR
Interrupted system call

o EINVAL
Invalid argument

o EIO
I/O error

o EISDIR
Is a directory

o ELIBACC
Cannot access a needed shared library

o ELIBBAD
Accessing a corrupted shared library

o ELIBEXEC
Cannot exec a shared library directly

o ELIBMAX
Attempting to link in more shared libraries than system limit

o ELIBSCN
.BR .lib 
section in a.out corrupted

o EMFILE
Too many open files

o EMLINK
Too many links

o EMULTIHOP
Multihop attempted

o ENAMETOOLONG
File or path name too long

o ENFILE
Too many open files in system

o ENODEV
No such device

o ENOENT
No such file or directory

o ENOEXEC
Exec format error

o ENOLCK
No lock

o ENOLINK
Virtual circuit is gone

o ENOMEM
Not enough space

o ENOMSG
No message of desired type

o ENONET
Machine is not on the network

o ENOPKG
No package

o ENOSPC
No space left on device

o ENOSR
No stream resources

o ENOSTR
Not a stream

o ENOSYS
Function not implemented

o ENOTBLK
Block device required

o ENOTDIR
Not a directory

o ENOTEMPTY
Directory not empty

o ENOTTY
Not a character device

o ENXIO
No such device or address

o EPERM
Not owner

o EPIPE
Broken pipe

o EPROTO
Protocol error

o ERANGE
Result too large

o EREMOTE
Resource is remote

o EROFS
Read-only file system

o ESPIPE
Illegal seek

o ESRCH
No such process

o ESRMNT
Srmount error

o ETIME
Stream ioctl timeout

o ETXTBSY
Text file busy

o EXDEV
Cross-device link

o-
.SH RETURNS
This function returns a pointer to a string. Your application must
not modify that string.
.SH PORTABILITY
ANSI C requires 
.BR strerror ,
but does not specify the strings used
for each error number.

Although this implementation of 
.BR strerror 
is reentrant, ANSI C
declares that subsequent calls to 
.BR strerror 
may overwrite the
result string; therefore portable code cannot depend on the reentrancy
of this subroutine.

This implementation of 
.BR strerror 
provides for user-defined
extensibility. 
.BR errno.h 
defines 
.IR __ELASTERROR ,
which can be
used as a base for user-defined error values. If the user supplies a
routine named 
.BR _user_strerror ,
and 
.IR errnum 
passed to
.BR strerror 
does not match any of the supported values,
.BR _user_strerror 
is called with 
.IR errnum 
as its argument.

.BR _user_strerror 
takes one argument of type 
.IR int ,
and returns a
character pointer. If 
.IR errnum 
is unknown to 
.BR _user_strerror ,
.BR _user_strerror 
returns 
.IR NULL .
The default 
.BR _user_strerror 
returns 
.IR NULL 
for all input values.

.BR strerror 
requires no supporting OS subroutines.
.SH QUICKREF
strerror ansi pure
.SH SOURCE
src/newlib/libc/string/strerror.c
